#!/usr/bin/env bash

user="$1"
project="$2"
if [ -z "$project" ]; then
    echo "Usage: username project"
    exit 1
fi

cd /tmp
git clone "https://github.com/$user/$project" || true
cd "$project"
git pull

if [ -f project.clj ]; then
    lein_classpath="$(lein classpath)"
fi
clj_classpath="$(clojure -Spath)"

classpath="$lein_classpath:$clj_classpath"
# echo "Linting $classpath"

clj-kondo --lint "$classpath" src test resources
